<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="vue.js"></script>
    
    
</head>

<body>
    <div id="app">
        <input v-model="firstName">
        <input v-model="lastName">
        <input v-model="city.state">
        <h2>{{fullNmae}}</h2>
        <h2>{{qm}}</h2>
    </div>
      
      <script>
        var vm=new Vue({
            el:"#app",
            data:{
                firstName:"Mical",
                lastName:"Jordan",
                fullNmae:"Mical Jordan",
                city:{state:"cal",name:"los"}
            },
            watch:{
                firstName:function(val){
                    this.fullNmae=val+" "+this.lastName;
                }
            },
            city:{
                handler(newv,oldv)
               {
                    this.city.name=this.firstName;
                },
                deep:true,
                immediate:true

            },
            computed:{
                qm:function(){
                    return this.firstName+" "+this.lastName;
                }
            }
        })
      </script>
  
</body>

<html>
